package io;

import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

/**
 * @version 1.8
 * @Author Djx_hmbb
 * @Date 2023/8/30 16:54
 * @注释:输出流的字符流Writer/手动刷新
 */
public class IODemo10 {
    public static void main(String[] args) throws IOException {
        try(Writer writer = new FileWriter("./ddd.txt")){
            /*writer.write(97);
            writer.write(98);
            writer.write(99);*/
            /*writer.append("97");
            writer.append("98");
            writer.append("99");*/
            char[] tmp = new char[5];//用来缓存一次读取的字符个数
            tmp[0] = 97;
            tmp[1] = 98;
            tmp[2] = 99;
            tmp[3] = 100;
            tmp[4] = 101;
            writer.write(tmp,1,2);//off是tmp的下标,len是长度
            //手动刷新缓存区
            writer.flush();
        }
    }
}
